﻿<Controls:SinacorWindow 
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
          xmlns:Custom="http://schemas.xceed.com/wpf/xaml/datagrid"
          xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
          mc:Ignorable="d"
          xmlns:Model="clr-namespace:Sinacor.UI.Bovespa.ManutencaoOrdens.Model;assembly=Sinacor.UI.Bovespa.ManutencaoOrdens.Model"
          xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls"
          xmlns:Validation="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Validation;assembly=Sinacor.Infra.UI.Controls"
          WindowStartupLocation="CenterScreen"
          AutoContentHeight="True" 
          AutoContentWidth="True"
          WindowState="Maximized" 
          Title="{DynamicResource Bovespa.Ordens.Label.ManutencaoOrdens}" 
          x:Class="Sinacor.UI.Bovespa.ManutencaoOrdens.View.SmartClient.ManutencaoOrdens" 
          ModulePlus="False"
          ModuleId="ORD">

    <Controls:SinacorExpanderContainer x:Name="ExpanderContainer"
                                       VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Controls:SinacorTabControl IsSynchronizedWithCurrentItem="True"
                                    Margin="0,0,0,0"
									Grid.Row="0" Name="tabControlPrincipal">
            <!-- TAB FILTRO PESQUISA -->
            <Controls:SinacorTabItem Header="{DynamicResource Bovespa.Ordens.Label.Pesquisa}" Name="tabPesquisa">
                <Grid x:Name="GridPesquisa">
                    <Controls:SinacorExpanderContainer Visibility="Visible">

                        <Controls:SinacorExpander HorizontalAlignment="Stretch"
                                                  VerticalAlignment="Top"
                                                  Header="{DynamicResource Bovespa.Ordens.Label.Pesquisa}"
                                                  AllowExpand="False"
                                                  Height="275"
                                                  IsExpanded="True" Name="ExpanderPesquisa">
                            <Grid>
                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                       Content="{DynamicResource Bovespa.Ordens.Label.Data}"
                                                       Width="56"/>

                                <Controls:SinacorComboBox HorizontalAlignment="Left"
                                                          VerticalAlignment="Top"
                                                          Margin="60,0,0,0"
                                                          Width="97"
                                                          TabIndex="1"
                                                          Name="cmbDataFiltro"
                                                          IsRequired="True"
                                                          ItemsSource="{Binding CalendarioFiltro}"
                                                          SelectedValuePath="DataFormatada" 
                                                          DisplayMemberPath="DataFormatada" 
                                                          SelectedValue="{Binding FiltroOrdens.DataPregao}"/>

                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                       Content="{DynamicResource Bovespa.Ordens.Label.NumeroOrdem}"
                                                       Width="120"
                                                       Margin="165,0,0,0"/>

                                <Controls:SinacorInt32TextBox VerticalAlignment="Top"
                                                         Margin="288,0,0,0"
                                                         Width="120"
                                                         TabIndex="2"
                                                         Integers="9"
                                                         IsFormated="True"
                                                         Name="txtNumeroOrdemFiltro"
                                                         Value="{Binding FiltroOrdens.Numero}"
                                                         HorizontalAlignment="Left">

                                    <Controls:SinacorTextBox.ValidationRules>
                                        <Validation:EventValidationRule Validating="txtNumeroOrdemFiltro_Validating"/>
                                    </Controls:SinacorTextBox.ValidationRules>

                                </Controls:SinacorInt32TextBox>

                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                       Content="{DynamicResource Bovespa.Ordens.Label.Situacao}"
                                                       Width="70"
                                                       Margin="412,0,0,0"/>

                                <Controls:SinacorTextBox VerticalAlignment="Top"
                                                         Margin="486,0,0,0"
                                                         Width="60"
                                                         HorizontalAlignment="Left"
                                                         TabIndex="3"
                                                         Name="txtSituacaoOrdemFiltro"
                                                         MaxLength="1"
                                                         CharacterCasing="Upper"/>

                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                       Width="75"
                                                       Margin="561,0,0,0" 
													   Content="{DynamicResource Bovespa.Ordens.Label.Ativo}"/>

                                <Controls:SinacorTextBox HorizontalAlignment="Left"
                                                         VerticalAlignment="Top"
                                                         MaxLength="12"
                                                         Margin="640,0,0,0"
                                                         Width="160"
                                                         TabIndex="4"
                                                         Name="txtAtivoFiltro"
                                                         CharacterCasing="Upper"
                                                         Text="{Binding FiltroOrdens.Ativo}">

                                    <Controls:SinacorTextBox.ValidationRules>
                                        <Validation:EventValidationRule Validating="txtAtivoFiltro_Validating"/>
                                    </Controls:SinacorTextBox.ValidationRules>

                                </Controls:SinacorTextBox>

                                <Controls:SinacorButton HorizontalAlignment="Left"
                                                        VerticalAlignment="Top"
                                                        Margin="804,0,0,0"
                                                        Icon="IconButtonSearch"
                                                        TabIndex="5" 
														ToolTip="{DynamicResource Bovespa.Ordens.Tooltip.PesquisarAtivo}" 
                                                        x:Name="btnAtivo"/>

                                <Controls:SinacorRadioButton HorizontalAlignment="Left"
                                                             Margin="0,25,0,0"
                                                             VerticalAlignment="Top"
                                                             Content="{DynamicResource Bovespa.Ordens.Label.Cliente}"
                                                             GroupName="TipoUsuario"
                                                             IsChecked="True" TabIndex="6"
                                                             Name="rbCliente"/>

                                <Controls:SinacorRadioButton HorizontalAlignment="Left"
                                                             Margin="104,25,0,0"
                                                             VerticalAlignment="Top"
                                                             Content="{DynamicResource Bovespa.Ordens.Label.Broker}"
                                                             GroupName="TipoUsuario" TabIndex="7"
                                                             Name="rbBroker"/>

                                <Controls:SinacorTextBox VerticalAlignment="Top"
                                                         Margin="0,46,0,0"
                                                         Width="382"
                                                         TabIndex="8"
                                                         MaxLength="18"
                                                         HorizontalAlignment="Left"
                                                         Name="txtClienteOrdemFiltro"
                                                         CharacterCasing="Upper"
                                                         Text="{Binding FiltroOrdens.ApelidoCliente}">

                                    <Controls:SinacorTextBox.ValidationRules>
                                        <Validation:EventValidationRule Validating="txtClienteOrdemFiltro_Validating"/>
                                    </Controls:SinacorTextBox.ValidationRules>

                                </Controls:SinacorTextBox>

                                <Controls:SinacorButton HorizontalAlignment="Left" 
                                                        VerticalAlignment="Top" 
                                                        Icon="IconButtonClient" 
                                                        ToolTip="{DynamicResource Bovespa.Ordens.Tooltip.PesquisarCliente}"
														TabIndex="9"
														Margin="386,46,0,0"
                                                        Name="btnCliente"/>

                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                       Content="{DynamicResource Bovespa.Ordens.Label.Operador}"
                                                       Width="85"
                                                       Margin="436,25,0,0"
                                                       HorizontalContentAlignment="Left"/>

                                <Controls:SinacorComboBox VerticalAlignment="Top"
                                                          IsSynchronizedWithCurrentItem="True"
                                                          Margin="436,46,0,0"
                                                          Width="247"
                                                          HorizontalAlignment="Left"
                                                          TabIndex="10"
                                                          Name="cmbOperador"
                                                          ItemsSource="{Binding OperadoresSubordinados}"
                                                          SelectedValuePath="CodigoOperador" 
                                                          DisplayMemberPath="LoginOperador" 
                                                          SelectedValue="{Binding FiltroOrdens.Operador}"/>

                                <Controls:SinacorGroupBox VerticalAlignment="Top"
                                                          Header="{DynamicResource Bovespa.Ordens.Label.Natureza}"
                                                          Width="150"
                                                          Height="150"
                                                          Margin="0,75,0,0"
                                                          HorizontalAlignment="Left">

                                    <Grid HorizontalAlignment="Left"
                                                           VerticalAlignment="Top"
                                                           Margin="0,-4,0,0">
                                        <Controls:SinacorRadioButton Margin="0,0,0,0"
                                                                     HorizontalAlignment="Left"
                                                                     Content="{DynamicResource Bovespa.Ordens.Label.Compra}"
                                                                     Width="100"
                                                                     VerticalAlignment="Top"
                                                                     TabIndex="11"
                                                                     Name="rbCompraFiltro"/>

                                        <Controls:SinacorRadioButton Margin="0,25,0,0"
                                                                     Width="100"
                                                                     Content="{DynamicResource Bovespa.Ordens.Label.Venda}"
                                                                     VerticalAlignment="Top"
                                                                     HorizontalAlignment="Left"
                                                                     TabIndex="12"
                                                                     Name="rbVendaFiltro"/>

                                        <Controls:SinacorRadioButton HorizontalAlignment="Left"
                                                                     Width="111"
                                                                     Content="{DynamicResource Bovespa.Ordens.Label.TipoMercado.OpcaoVendaCompra}"
                                                                     VerticalAlignment="Top"
                                                                     Margin="0,50,0,0"
                                                                     TabIndex="13"
                                                                     Name="rbCompraVendaFiltro"/>

                                    </Grid>

                                </Controls:SinacorGroupBox>

                                <Controls:SinacorGroupBox 	Header="{DynamicResource Bovespa.Ordens.Label.OpcoesExibicao}" 
                                                                    Width="300" 
                                                                    Margin="154,75,0,0" 
                                                                    HorizontalAlignment="Left"
                                                                    VerticalAlignment="Top"
                                                                    Visibility="Visible"
                                                                    Height="150">
                                    <Grid 		HorizontalAlignment="Stretch" 	
                                                     VerticalAlignment="Stretch" 	
                                                     Margin="0,-4,0,0">

                                        <Controls:SinacorCheckBox Content="{DynamicResource Bovespa.Ordens.Label.ExibirOrdensValidas}" 		
                                                                              Margin="0,0,0,0" 		
                                                                              Width="270" 		
                                                                              TabIndex="14"
                                                                              HorizontalAlignment="Left"
                                                                              VerticalAlignment="Top"
                                                                              Name="chkOrdensValidasFiltro"
                                                                              IsChecked="{Binding FiltroOrdens.ApenasValidas}"/>

                                        <Controls:SinacorCheckBox VerticalAlignment="Top" 		
                                                                  Content="{DynamicResource Bovespa.Ordens.Label.AlteracoesPendentesJustificativas}" 		
                                                                  Margin="0,25,0,0" 		
                                                                  Width="270" 		
                                                                  TabIndex="15" 		
                                                                  HorizontalAlignment="Left"
                                                                  Name="chkOrdensPendentesJustificativasFiltro"
                                                                  IsChecked="{Binding FiltroOrdens.ApenasPendentesJustificativa}"/>

                                        <Controls:SinacorCheckBox VerticalAlignment="Top" 		
                                                                  Content="{DynamicResource Bovespa.Ordens.Label.RecebidasChat}" 		
                                                                  Margin="0,50,0,0" 		
                                                                  Width="270" 		
                                                                  TabIndex="16" 		
                                                                  HorizontalAlignment="Left"
                                                                  Name="chkOrdensRecebidasViaCanalFiltro"
                                                                  IsChecked="{Binding FiltroOrdens.ApenasRecebidasViaCanal}"/>

                                        <Controls:SinacorCheckBox Content="{DynamicResource Bovespa.Ordens.Label.SemClientes}" 		
                                                                              Margin="0,75,0,0" 		
                                                                              Width="270" 		
                                                                              TabIndex="17" 		
                                                                              HorizontalAlignment="Left"
                                                                              VerticalAlignment="Top"
                                                                              Name="chkOrdensSemClienteFiltro"
                                                                              IsChecked="{Binding FiltroOrdens.ApenasSemCliente}"/>

                                        <Controls:SinacorCheckBox Content="{DynamicResource Bovespa.ManutencaoOrdens.Label.DiscricionariasNaoDistribuidas}" 		
                                                                              Margin="0,100,0,0" 		
                                                                              Width="270" 		
                                                                              TabIndex="17" 		
                                                                              HorizontalAlignment="Left"
                                                                              VerticalAlignment="Top"
                                                                              Name="chkApenasDiscricionariasNaoDistribuidas"
                                                                              IsChecked="{Binding FiltroOrdens.ApenasDiscricionariasNaoDistribuidas}"/>
                                    </Grid>
                                </Controls:SinacorGroupBox>
                                <Controls:SinacorGroupBox 	
                                    Header="{DynamicResource Bovespa.Ordens.Label.EstadoOrdem}" 
                                	Width="251" 
                                	Margin="458,75,0,0"
                                	Visibility="Visible"
                                	Height="150" 
                                    VerticalAlignment="Top" 
                                    HorizontalAlignment="Left">
                                    <Grid 	HorizontalAlignment="Stretch" 	
                                			VerticalAlignment="Stretch" 	
                                			Margin="0,-4,0,0">

                                        <Controls:SinacorCheckBox Content="{DynamicResource Bovespa.Ordens.Label.Casadas}" 		
                                			Margin="0,0,0,0" 		
                                			Width="220" 		
                                			TabIndex="18" 		
                                			Foreground="{DynamicResource BrushGridRowBusiness02}"
                                			HorizontalAlignment="Left"
                                			VerticalAlignment="Top"
                                            Name="chkCasadasFiltro" 
                                            IsChecked="{Binding FiltroOrdens.Casadas}"/>

                                        <Controls:SinacorCheckBox VerticalAlignment="Top" 		
                                			Content="{DynamicResource Bovespa.Ordens.Label.NaoCasadas}" 		
                                			Margin="0,25,0,46" 		
                                			Width="220" 		
                                			TabIndex="19" 		
                                			Foreground="{DynamicResource BrushGridRowBusiness06}"
                                			HorizontalAlignment="Left"
                                            IsChecked="{Binding FiltroOrdens.NaoCasadas}"/>

                                        <Controls:SinacorCheckBox VerticalAlignment="Top" 		
                                			Content="{DynamicResource Bovespa.Ordens.Label.CasadasParcialmente}" 		
                                			Margin="0,50,0,0" 		
                                			Width="220" 		
                                			TabIndex="20" 		
                                			Foreground="{DynamicResource BrushGridRowBusiness04}"
                                			HorizontalAlignment="Left"
                                            Name="chkCasadasParcialmenteFiltro" 
                                            IsChecked="{Binding FiltroOrdens.CasadasParcialmente}"/>

                                        <Controls:SinacorCheckBox Content="{DynamicResource Bovespa.Ordens.Label.NaoCasadasPreBoleto}" 		
                                			Margin="0,75,0,0" 		
                                			Width="220" 		
                                			TabIndex="21" 		
                                			Foreground="{DynamicResource BrushGridRowBusiness03}"
                                			VerticalAlignment="Top"
                                			HorizontalAlignment="Left"
                                            Name="chkNaoCasadasPreBoletoFiltro" 
                                            IsChecked="{Binding FiltroOrdens.NaoCasadasPreBoleto}"/>

                                    </Grid>
                                </Controls:SinacorGroupBox>
                                <Controls:SinacorButton HorizontalAlignment="Left"
                                                        VerticalAlignment="Top"
                                                        Content="{DynamicResource Bovespa.Ordens.Label.Pesquisar}"
                                                        Margin="715,203,0,0"
                                                        Width="85"
                                                        TabIndex="22"
                                                        IsDefault="True"
                                                        Name="btnPesquisarFiltro"
                                                        CausesValidation="True"/>

                                <Controls:SinacorButton HorizontalAlignment="Left" 
                                                        VerticalAlignment="Top"
                                                        Margin="804,203,0,0" 
                                                        TabIndex="23" 
                                                        IsDefault="False"
                                                        Name="btnNovaPesquisa"
														Content="{DynamicResource Bovespa.Ordens.Label.NovaPesquisa}"
                                                        CausesValidation="False"/>
                            </Grid>
                        </Controls:SinacorExpander>
                    </Controls:SinacorExpanderContainer>
                </Grid>
            </Controls:SinacorTabItem>
            <!-- TAB ORDENS -->
            <Controls:SinacorTabItem Header="{DynamicResource Bovespa.Ordens.Label.Ordens}" Name="tabOrdens" ScrollViewer.VerticalScrollBarVisibility="Auto">
                <Grid HorizontalAlignment="Stretch"
                      VerticalAlignment="Stretch"
                      x:Name="gridOrdens">
                    <Controls:SinacorScrollViewer VerticalAlignment="Top"
                                                  HorizontalAlignment="Left"
                                                  Height="{Binding Path=ActualHeight, ElementName=gridOrdens, Mode=Default}"
                                                  Width="{Binding Path=ActualWidth, ElementName=gridOrdens, Mode=Default}"
                                                  x:Name="SsvOrdens">
                        <Controls:SinacorExpanderContainer Visibility="Visible">
                            <Controls:SinacorExpanderContainer.RowDefinitions>
                                <RowDefinition Height="{Binding Path=ActualHeight, ElementName=SsvOrdens, Mode=Default}"/>
                            </Controls:SinacorExpanderContainer.RowDefinitions>

                            <Controls:SinacorExpander HorizontalAlignment="Stretch"
                                                      VerticalAlignment="Stretch"
                                                      Header="{DynamicResource Bovespa.Ordens.Label.DetalhamentoOrdens}"
                                                      IsExpanded="True" 
                                                      Grid.Row="0"
                                                      AllowExpand="False"
                                                      Visibility="Collapsed"
                                                      x:Name="ExpFormularioOrdens">
                                
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="5" />
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>

                                    <Grid Grid.Row="0">
                                        <Controls:SinacorGroupBox Header="{DynamicResource Bovespa.Ordens.Label.Ordem}"
                                                              Height="99"
                                                              Margin="0,0,0,0"
                                                              VerticalAlignment="Top"
                                                              HorizontalAlignment="Left"
                                                              Width="940">
                                            <Grid HorizontalAlignment="Stretch"
                                                                  VerticalAlignment="Stretch"
                                                                  Margin="0,-5,0,0">
                                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Data}"
                                                                   Margin="0,0,0,0"
                                                                   Width="47"
                                                                   VerticalAlignment="Top"/>
                                                <Controls:SinacorDatePicker HorizontalAlignment="Left"
                                                                        VerticalAlignment="Top"
                                                                        Margin="51,0,0,0"
                                                                        TabIndex="1"
                                                                        Value="{Binding OrdemAtual.DataOrdem}"
                                                                        IsEnabled="False"
                                                                        x:Name="DtpFormularioDataOrdem"/>
                                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                                   Margin="160,0,0,0"
                                                                   Width="63"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Numero}"
                                                                   VerticalAlignment="Top"/>
                                                <Controls:SinacorTextBox HorizontalAlignment="Left"
                                                                     VerticalAlignment="Top"
                                                                     Margin="227,0,0,0"
                                                                     Width="78"
                                                                     TabIndex="2"
                                                                     IsEnabled="False"
                                                                     Text="{Binding OrdemAtual.NumeroOrdem}"
                                                                     x:Name="TxtFormularioNumeroOrdem"/>
                                                <Controls:SinacorTextBox HorizontalAlignment="Left"
                                                                     VerticalAlignment="Top"
                                                                     Margin="309,0,0,0"
                                                                     Width="47"
                                                                     TabIndex="3"
                                                                     IsEnabled="False"
                                                                     Text="{Binding OrdemAtual.NumeroOrdemSubSequencia}"
                                                                     x:Name="TxtFormularioNumeroOrdemSubSequencia"/>
                                                <Controls:SinacorLabel Margin="360,0,0,0"
                                                                   Width="66"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Situacao}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalAlignment="Left"/>
                                                <Controls:SinacorComboBox VerticalAlignment="Top"
                                                                     Margin="430,0,0,0"
                                                                     Width="32"
                                                                     HorizontalAlignment="Left"
                                                                     IsSynchronizedWithCurrentItem="True"
                                                                     TabIndex="4" 
                                                                     ItemsSource="{Binding TiposSituacao}"
                                                                     SelectedValue="{Binding OrdemAtual.Situacao}"
                                                                     IsRequired="True"
                                                                     x:Name="CboFormularioSituacao"/>
                                                <Controls:SinacorLabel Margin="466,0,0,0"
                                                                   Width="61"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Carteira}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalAlignment="Left"/>
                                                <Controls:SinacorInt32TextBox Margin="531,0,0,0"
                                                                          Width="35"
                                                                          HorizontalAlignment="Left"
                                                                          VerticalAlignment="Top"
                                                                          TabIndex="5" 
                                                                          Integers="3" 
                                                                          IsFormated="False"
                                                                          Value="{Binding OrdemAtual.Carteira, UpdateSourceTrigger=PropertyChanged}"
                                                                          x:Name="TxtFormularioCarteira"/>
                                                <Controls:SinacorLabel Margin="570,0,0,0"
                                                                   Width="96"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.OrdemOriginal}"
                                                                   HorizontalAlignment="Left"
                                                                   VerticalAlignment="Top"/>
                                                <Controls:SinacorInt32TextBox VerticalAlignment="Top"
                                                                     Margin="670,0,0,0"
                                                                     Width="78"
                                                                     HorizontalAlignment="Left"
                                                                     TabIndex="6"
                                                                     Integers="9"
                                                                     IsFormated="True"
                                                                     Value="{Binding OrdemAtual.NumeroOrdemOriginal, UpdateSourceTrigger=PropertyChanged}"
                                                                     x:Name="TxtFormularioNumeroOrdemOriginal"/>
                                                <Controls:SinacorLabel Margin="752,0,0,0"
                                                                   Width="64"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Validade}"
                                                                   HorizontalAlignment="Left"
                                                                   VerticalAlignment="Top"/>
                                                <Controls:SinacorDatePicker Margin="820,0,0,0"
                                                                        HorizontalAlignment="Left"
                                                                        VerticalAlignment="Top"
                                                                        TabIndex="7"
                                                                        Value="{Binding OrdemAtual.DataValidade}"
                                                                        x:Name="DtpFormularioValidade"/>
                                                <Controls:SinacorGroupBox Header="{DynamicResource Bovespa.Ordens.Label.Natureza}"
                                                                      Width="196"
                                                                      Height="46"
                                                                      Margin="0,25,0,0"
                                                                      HorizontalAlignment="Left"
                                                                      VerticalAlignment="Top">

                                                    <Grid Width="180"
                                                      Height="Auto"
                                                      HorizontalAlignment="Left"
                                                      VerticalAlignment="Top"
                                                      Margin="0,-5,0,0">
                                                        <Controls:SinacorRadioButton HorizontalAlignment="Left"
                                                                                 Content="{DynamicResource Bovespa.Ordens.Label.Compra}"
                                                                                 Width="91"
                                                                                 VerticalAlignment="Top"
                                                                                 TabIndex="8"
                                                                                 x:Name="RbtFormularioNaturezaCompra"/>
                                                        <Controls:SinacorRadioButton Margin="95,0,0,0"
                                                                                 Width="82"
                                                                                 Content="{DynamicResource Bovespa.Ordens.Label.Venda}"
                                                                                 HorizontalAlignment="Left"
                                                                                 VerticalAlignment="Top"
                                                                                 TabIndex="9"
                                                                                 x:Name="RbtFormularioNaturezaVenda"/>
                                                    </Grid>
                                                </Controls:SinacorGroupBox>
                                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                                   Margin="200,42,0,0"
                                                                   Width="48"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Tipo}"
                                                                   VerticalAlignment="Top"/>
                                                <Controls:SinacorComboBox HorizontalAlignment="Left"
                                                                      VerticalAlignment="Top"
                                                                      IsSynchronizedWithCurrentItem="True"
                                                                      Margin="252,42,0,0"
                                                                      Width="131"
                                                                      TabIndex="10"
                                                                      IsRequired="True"
                                                                      RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.TipoOrdemObrigatorio"
                                                                      ItemsSource="{Binding TiposOrdens}"
                                                                      SelectedValue="{Binding OrdemAtual.TipoOrdem}"
                                                                      x:Name="CboFormularioTipoOrdem"/>
                                                <Controls:SinacorCheckBox Width="185"
                                                                      Content="{DynamicResource Bovespa.Ordens.Label.AdministradoConcorrente}"
                                                                      HorizontalAlignment="Left"
                                                                      Margin="387,28,0,0"
                                                                      VerticalAlignment="Top"
                                                                      TabIndex="11"
                                                                      IsChecked="{Binding OrdemAtual.IndicadorOrdemAdmConcorrente}"
                                                                      IsEnabled="False"
                                                                      x:Name="ChkFormularioIndicadorOrdemAdmConcorrente"/>
                                                <Controls:SinacorCheckBox VerticalAlignment="Top"
                                                                      Width="134"
                                                                      Content="{DynamicResource Bovespa.Ordens.Label.Discricionaria}"
                                                                      HorizontalAlignment="Left"
                                                                      Margin="387,46,0,0"
                                                                      TabIndex="12"
                                                                      IsChecked="{Binding OrdemAtual.Discricionaria}"
                                                                      x:Name="ChkFormularioDiscricionaria"/>
                                                <Controls:SinacorGroupBox Header="{DynamicResource Bovespa.Ordens.Label.Financiamento}"
                                                                      Width="340"
                                                                      Height="46"
                                                                      Margin="585,25,0,0"
                                                                      HorizontalAlignment="Left"
                                                                      VerticalAlignment="Top">
                                                    <Grid Width="330"
                                                      Height="Auto"
                                                      HorizontalAlignment="Left"
                                                      VerticalAlignment="Top"
                                                      Margin="0,-5,0,0">
                                                        <Controls:SinacorLabel HorizontalAlignment="Left"
                                                                           Content="{DynamicResource Bovespa.Ordens.Label.Valor}"
                                                                           Width="51"/>
                                                        <Controls:SinacorDecimalTextBox Margin="55,0,175,0"
                                                                                    TabIndex="13"
                                                                                    Integers="13"
                                                                                    Decimals="2"
                                                                                    AcceptsNegative="False"
                                                                                    RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.ValorFinanciamentoInvalido"
                                                                                    Value="{Binding OrdemAtual.ValorFinanciamento, UpdateSourceTrigger=PropertyChanged}"
                                                                                    x:Name="TxtFormularioValorFinanciamento"/>
                                                        <Controls:SinacorLabel Width="30"
                                                                           Content="{DynamicResource Bovespa.Ordens.Label.SimboloPorcentagem}"
                                                                           Margin="177.5,0,0,0"
                                                                           VerticalAlignment="Top"
                                                                           HorizontalAlignment="Left"/>
                                                        <Controls:SinacorDecimalTextBox Margin="201,0,8,0"
                                                                                    TabIndex="14"
                                                                                    Integers="4"
                                                                                    Decimals="6"
                                                                                    IsFormated="True"
                                                                                    AcceptsNegative="False"
                                                                                    RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.PercentualFinanciamentoInvalido"
                                                                                    Value="{Binding OrdemAtual.PercentualFinanciamento, UpdateSourceTrigger=PropertyChanged}"
                                                                                    x:Name="TxtFormularioPercentualFinanciamento"/>
                                                    </Grid>
                                                </Controls:SinacorGroupBox>
                                            </Grid>
                                        </Controls:SinacorGroupBox>
                                        <Controls:SinacorGroupBox Header="{DynamicResource Bovespa.Ordens.Label.Cliente}"
                                                              Width="940"
                                                              Height="118"
                                                              Margin="0,104,0,0"
                                                              HorizontalAlignment="Left"
                                                              VerticalAlignment="Top">
                                            <Grid Width="930"
                                              Height="92"
                                              HorizontalAlignment="Left"
                                              VerticalAlignment="Top"
                                              Margin="0,-8,0,0">
                                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                                   Width="76"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Apelido}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"/>
                                                <Controls:SinacorTextBox HorizontalAlignment="Left"
                                                                     Margin="0,21,0,0"
                                                                     Width="178"
                                                                     VerticalAlignment="Top"
                                                                     TabIndex="15"
                                                                     MaxLength="18" 
                                                                     IsRequired="True" 
                                                                     CharacterCasing="Upper"
                                                                     RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.CodigoClienteObrigatorio"
                                                                     Text="{Binding OrdemAtual.ApelidoCliente}"
                                                                     x:Name="TxtFormularioApelidoCliente">
                                                    <Controls:SinacorTextBox.ValidationRules>
                                                        <Validation:EventValidationRule Validating="txtClienteOrdem_ValidaCliente" />
                                                    </Controls:SinacorTextBox.ValidationRules>
                                                </Controls:SinacorTextBox>

                                                <Controls:SinacorInt32TextBox Margin="182,21,0,0"
                                                                     Width="28"
                                                                     HorizontalAlignment="Left"
                                                                     VerticalAlignment="Top"
                                                                     TabIndex="16"
                                                                     AcceptsNegative="False"
                                                                     Integers="1"
                                                                     RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.DigitoVerificadorObrigatorio"
                                                                     Value="{Binding OrdemAtual.DigitoCliente, UpdateSourceTrigger=PropertyChanged}"
                                                                     x:Name="TxtFormularioDigitoCliente">
                                                    <Controls:SinacorTextBox.ValidationRules>
                                                        <Validation:EventValidationRule Validating="txtInsertDigito_Validating" />
                                                    </Controls:SinacorTextBox.ValidationRules>
                                                </Controls:SinacorInt32TextBox>

                                                <Controls:SinacorButton HorizontalAlignment="Left"
                                                                    Margin="214,21,0,0"
                                                                    Icon="IconButtonSearch"
																	ToolTip="{DynamicResource Bovespa.Ordens.Label.Pesquisar}"
                                                                    VerticalAlignment="Top"
                                                                    TabIndex="17"
                                                                    CausesValidation="False"
                                                                    x:Name="BtnFormularioCliente"/>
                                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                                   Width="76"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Nome}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"
                                                                   Margin="241,0,0,0"/>
                                                <Controls:SinacorTextBox Margin="241,21,0,0"
                                                                     Width="685"
                                                                     VerticalAlignment="Top"
                                                                     HorizontalAlignment="Left"
                                                                     TabIndex="18"
                                                                     IsEnabled="False"
                                                                     Text="{Binding OrdemAtual.NomeCliente, UpdateSourceTrigger=PropertyChanged}"
                                                                     x:Name="TxtFormularioNomeCliente"/>
                                                <Controls:SinacorCheckBox Width="140"
                                                                      Content="{DynamicResource Bovespa.Ordens.Label.PessoaVinculada}"
                                                                      Margin="0,67,0,0"
                                                                      VerticalAlignment="Top"
                                                                      TabIndex="19"
                                                                      IsChecked="{Binding OrdemAtual.IndicadorClientePessoaVinculada}"
                                                                      IsEnabled="False"
                                                                      x:Name="ChkFormularioPessoaVinculada"/>
                                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                                   Margin="150,46,0,0"
                                                                   Width="66"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Broker}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"/>
                                                <Controls:SinacorTextBox Margin="150,67,0,0"
                                                                     Width="184"
                                                                     VerticalAlignment="Top"
                                                                     HorizontalAlignment="Left"
                                                                     TabIndex="20"
                                                                     MaxLength="20"
                                                                     IsEnabled="False"
                                                                     Text="{Binding OrdemAtual.CodigoBrokerCliente, UpdateSourceTrigger=PropertyChanged}"
                                                                     x:Name="TxtFormularioBroker"/>
                                                <Controls:SinacorLabel Margin="350,46,0,0"
                                                                   Width="132"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.PercentAcrescimoReducao}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"
                                                                   HorizontalAlignment="Left"/>
                                                <Controls:SinacorDecimalTextBox Margin="350,67,0,0"
                                                                            Width="120"
                                                                            VerticalAlignment="Top"
                                                                            HorizontalAlignment="Left"
                                                                            TabIndex="21"
                                                                            Integers="4"
                                                                            Decimals="8"
                                                                            AcceptsNegative="True"
                                                                            IsRequired="True"
                                                                            RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.PercentualCorretagemObrigatorio"
                                                                            Value="{Binding OrdemAtual.PercentualCorretagem}"
                                                                            x:Name="TxtFormularioPercentAcrescimoReducao"/>
                                                <Controls:SinacorLabel Margin="483,46,0,0"
                                                                   Width="113"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.TipoDeLiquidacao}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"
                                                                   HorizontalAlignment="Left"/>
                                                <Controls:SinacorComboBox Margin="483,67,0,0"
                                                                     Width="101"
                                                                     VerticalAlignment="Top"
                                                                     HorizontalAlignment="Left"
                                                                     IsSynchronizedWithCurrentItem="True"
                                                                     TabIndex="22"
                                                                     IsRequired="True"
                                                                     RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.TipoLiquidacaoObrigatorio"
                                                                     ItemsSource="{Binding TiposLiquidacao}"
                                                                     SelectedValue="{Binding OrdemAtual.TipoLiquidacao}"
                                                                     x:Name="CboFormularioTipoDeLiquidacao"/>
                                                <Controls:SinacorLabel Margin="599,46,0,0"
                                                                   Width="80"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Emissor}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"
                                                                   HorizontalAlignment="Left"/>
                                                <Controls:SinacorComboBox Margin="599,67,0,0"
                                                                      VerticalAlignment="Top"
                                                                      Width="327"
                                                                      IsSynchronizedWithCurrentItem="True"
                                                                      HorizontalAlignment="Left"
                                                                      TabIndex="23"
                                                                      ItemsSource="{Binding Emissores}"
                                                                      DisplayMemberPath="Nome"
                                                                      SelectedValuePath="Nome"
                                                                      SelectedValue="{Binding OrdemAtual.NomeEmissor}"
                                                                      x:Name="CboFormularioEmissor"/>
                                            </Grid>
                                        </Controls:SinacorGroupBox>
                                        <Controls:SinacorGroupBox Header="{DynamicResource Bovespa.Ordens.Label.Ativo}"
                                                              Width="664"
                                                              Height="68"
                                                              Margin="0,225,0,0"
                                                              HorizontalAlignment="Left"
                                                              VerticalAlignment="Top">
                                            <Grid Width="640"
                                              Height="Auto"
                                              HorizontalAlignment="Left"
                                              VerticalAlignment="Top"
                                              Margin="0,-8,0,0">
                                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                                   Margin="0,0,0,0"
                                                                   Width="66"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Ativo}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"/>
                                                <Controls:SinacorFilteredTextBox HorizontalAlignment="Left"
                                                                     Margin="0,21,0,0"
                                                                     Width="138"
                                                                     VerticalAlignment="Top"
                                                                     TabIndex="24"
                                                                     FilterExpression="^[a-zA-Z0-9]{0,12}$"
                                                                     MaxLength="12" 
                                                                     IsRequired="True" 
                                                                     CharacterCasing="Upper"
                                                                     RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.AtivoObrigatorioException"
                                                                     Text="{Binding OrdemAtual.Ativo}"
                                                                     x:Name="TxtFormularioAtivo">
                                                    <Controls:SinacorTextBox.ValidationRules>
                                                        <Validation:EventValidationRule Validating="txtAtivo_ValidaAtivo" />
                                                    </Controls:SinacorTextBox.ValidationRules>
                                                </Controls:SinacorFilteredTextBox>

                                                <Controls:SinacorButton HorizontalAlignment="Left"
                                                                    Margin="142,21,0,0"
                                                                    Icon="IconButtonSearch"
																	ToolTip="{DynamicResource Bovespa.Ordens.Label.Pesquisar}"
                                                                    VerticalAlignment="Top"
                                                                    TabIndex="25"
                                                                    CausesValidation="False"
                                                                    x:Name="BtnFormularioAtivo"/>
                                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                                   Margin="171,0,0,0"
                                                                   Width="82.991"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.descricao}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"/>
                                                <Controls:SinacorTextBox Margin="171,21,0,0"
                                                                     Width="344"
                                                                     VerticalAlignment="Top"
                                                                     HorizontalAlignment="Left"
                                                                     TabIndex="26"
                                                                     IsEnabled="False"
                                                                     Text="{Binding OrdemAtual.DescricaoAtivo, UpdateSourceTrigger=PropertyChanged}"
                                                                     x:Name="TxtFormularioDescricaoAtivo"/>
                                                <Controls:SinacorLabel Margin="521,0,0,0"
                                                                   Width="115"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.VencimentoTermo}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"
                                                                   HorizontalAlignment="Left"/>
                                                <Controls:SinacorInt32TextBox Margin="521,21,0,0"
                                                                          Width="116"
                                                                          HorizontalAlignment="Left"
                                                                          VerticalAlignment="Top"
                                                                          TabIndex="27"
                                                                          Integers="5"
                                                                          IsFormated="True"
                                                                          RequiredErrorMessage="Bovespa.Ordens.ExceptionMessage.VencimentoTermoInvalido"
                                                                          Value="{Binding OrdemAtual.PrazoVencimentoTermo, UpdateSourceTrigger=PropertyChanged}"
                                                                          x:Name="TxtFormularioVencimentoTermo"/>
                                            </Grid>
                                        </Controls:SinacorGroupBox>
                                        <Controls:SinacorGroupBox Header="{DynamicResource Bovespa.Ordens.Label.Mercado}"
                                                              Width="271"
                                                              Height="68"
                                                              Margin="668,225,0,0"
                                                              VerticalAlignment="Top"
                                                              HorizontalAlignment="Left">
                                            <Grid Height="Auto"
                                              HorizontalAlignment="Left"
                                              VerticalAlignment="Top"
                                              Margin="0,-8,0,0">
                                                <Controls:SinacorLabel Width="50"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Tipo}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalAlignment="Left"
                                                                   HorizontalContentAlignment="Left"
                                                                   Margin="0,0,0,0"/>
                                                <Controls:SinacorComboBox HorizontalAlignment="Left"
                                                                      Margin="0,21,0,0"
                                                                      VerticalAlignment="Top"
                                                                      Width="254"
                                                                      IsSynchronizedWithCurrentItem="True"
                                                                      TabIndex="28"
                                                                      WidthPopup="150"
                                                                      ItemsSource="{Binding TiposMercados}"
                                                                      SelectedValue="{Binding OrdemAtual.Mercado}"
                                                                      x:Name="CboFormularioTipoMercado"/>
                                            </Grid>
                                        </Controls:SinacorGroupBox>
                                        <Controls:SinacorGroupBox Header="{DynamicResource Bovespa.Ordens.Label.Quantidades}"
                                                              Width="940"
                                                              Height="111"
                                                              Margin="0,296,0,0"
                                                              HorizontalAlignment="Left"
                                                              VerticalAlignment="Top">
                                            <Grid Width="938"
                                              Height="90"
                                              HorizontalAlignment="Left"
                                              VerticalAlignment="Top"
                                              Margin="0,-8,0,0">
                                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                                   Width="60"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Bolsa}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"/>
                                                <Controls:SinacorComboBox IsSynchronizedWithCurrentItem="True"
                                                                      Margin="0,21,0,0"
                                                                      Width="160"
                                                                      HorizontalAlignment="Left"
                                                                      VerticalAlignment="Top"
                                                                      WidthPopup="347"
                                                                      TabIndex="29"
                                                                      ItemsSource="{Binding Bolsas}"
                                                                      DisplayMemberPath="Descricao"
                                                                      SelectedValuePath="Codigo"
                                                                      SelectedValue="{Binding OrdemAtual.CodigoBolsa}"
                                                                      x:Name="CboFormularioBolsa"/>
                                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                                   Width="80"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Operador}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"
                                                                   Margin="0,42,0,0"/>
                                                <Controls:SinacorComboBox IsSynchronizedWithCurrentItem="True"
                                                                      Margin="0,63,0,0"
                                                                      Width="160"
                                                                      HorizontalAlignment="Left"
                                                                      VerticalAlignment="Top"
                                                                      WidthPopup="190"
                                                                      TabIndex="35"
                                                                      IsRequired="True"
                                                                      RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.OperadorObrigatorio"
                                                                      ItemsSource="{Binding OperadoresSubordinadosGrid}"
                                                                      SelectedValuePath="CodigoOperador" 
                                                                      DisplayMemberPath="LoginOperador"
                                                                      SelectedValue="{Binding OrdemAtual.CodigoOperador}"
                                                                      x:Name="CboFormularioOperador"/>
                                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                                   Width="97"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Quantidade}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"
                                                                   Margin="165,0,0,0"/>
                                                <Controls:SinacorDecimalTextBox VerticalAlignment="Top"
                                                                     Margin="165,21,0,0"
                                                                     Width="130"
                                                                     HorizontalAlignment="Left"
                                                                     TabIndex="30"
                                                                     AcceptsNegative="False"                                                                                    
                                                                     Integers="12" 
                                                                     Decimals="4" 
                                                                     IsFormated="True"
                                                                     RequiredErrorMessage="Bovespa.ManutencaoOrdens.Message.QuantidadeObrigatoria"
                                                                     Value="{Binding OrdemAtual.Quantidade, UpdateSourceTrigger=PropertyChanged}"
                                                                     x:Name="TxtFormularioQuantidade">
                                                    <Controls:SinacorTextBox.ValidationRules>
                                                        <Validation:EventValidationRule Validating="txtQuantidade_ValidaQuantidade" />
                                                    </Controls:SinacorTextBox.ValidationRules>
                                                </Controls:SinacorDecimalTextBox>

                                                <Controls:SinacorLabel HorizontalAlignment="Left"
                                                                   Width="130"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.QuantidadeAnexo4}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"
                                                                   Margin="165,42,0,0"/>
                                                <Controls:SinacorDecimalTextBox Margin="165,63,0,0"
                                                                     Width="130"
                                                                     HorizontalAlignment="Left"
                                                                     VerticalAlignment="Top"
                                                                     TabIndex="36"
                                                                     Integers="12"
                                                                     Decimals="4"
                                                                     IsFormated="True"
                                                                     Value="{Binding OrdemAtual.QuantidadeAnexoIV, UpdateSourceTrigger=PropertyChanged}"
                                                                     x:Name="TxtFormularioQuantidadeAnexo4"/>
                                                <Controls:SinacorLabel Width="97"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Preco}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"
                                                                   Margin="301,0,0,0"
                                                                   HorizontalAlignment="Left"/>
                                                <Controls:SinacorDecimalTextBox Margin="301,21,0,0"
                                                                     Width="130"
                                                                     VerticalAlignment="Top"
                                                                     HorizontalAlignment="Left"
                                                                     TabIndex="32"
                                                                     Integers="12" 
                                                                     Decimals="4" 
                                                                     IsFormated="True"                                                                                     
                                                                     AcceptsNegative="False"                                                                                    
                                                                     Value="{Binding OrdemAtual.Preco, UpdateSourceTrigger=PropertyChanged}"
                                                                     x:Name="TxtFormularioPreco"/>
                                                <Controls:SinacorLabel Width="130"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.QuantidadeAnexo5}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"
                                                                   Margin="301,42,0,0"
                                                                   HorizontalAlignment="Left"/>
                                                <Controls:SinacorDecimalTextBox Margin="301,63,0,0"
                                                                            Width="130"
                                                                            VerticalAlignment="Top"
                                                                            HorizontalAlignment="Left"
                                                                            TabIndex="37"
                                                                            Integers="12"
                                                                            Decimals="4"
                                                                            IsFormated="True"
                                                                            Value="{Binding OrdemAtual.QuantidadeAnexoV, UpdateSourceTrigger=PropertyChanged}"
                                                                            x:Name="TxtFormularioQuantidadeAnexo5"/>
                                                <Controls:SinacorLabel Width="130"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.QuantidadeCasada}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"
                                                                   Margin="438,0,0,0"
                                                                   HorizontalAlignment="Left"/>
                                                <Controls:SinacorDecimalTextBox Margin="438,21,0,0"
                                                                     Width="130"
                                                                     VerticalAlignment="Top"
                                                                     HorizontalAlignment="Left"
                                                                     TabIndex="32"
                                                                     IsEnabled="False"
                                                                     Integers="13"
                                                                     Decimals="4"
                                                                     Value="{Binding OrdemAtual.QuantidadeExecutada}"
                                                                     x:Name="TxtFormularioQuantidadeExecutada"/>
                                                <Controls:SinacorLabel Width="127"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.ValorOrdem}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"
                                                                   Margin="438,42,0,0"
                                                                   HorizontalAlignment="Left"/>
                                                <Controls:SinacorTextBox Margin="438,63,0,0"
                                                                     Width="130"
                                                                     VerticalAlignment="Top"
                                                                     HorizontalAlignment="Left"
                                                                     TabIndex="38"
                                                                     IsEnabled="False"
                                                                     Text="{Binding OrdemAtual.ValorOrdem.ValorTotal}"
                                                                     x:Name="TxtFormularioValorOrdem"/>
                                                <Controls:SinacorLabel Width="130"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.IndSistExterno}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"
                                                                   Margin="574,0,0,0"
                                                                   HorizontalAlignment="Left"/>
                                                <Controls:SinacorTextBox Margin="574,21,0,0"
                                                                     Width="130"
                                                                     VerticalAlignment="Top"
                                                                     HorizontalAlignment="Left"
                                                                     TabIndex="33"
                                                                     MaxLength="18"
                                                                     Text="{Binding OrdemAtual.IndicadorSistemaExterno, UpdateSourceTrigger=PropertyChanged}" 
                                                                     x:Name="TxtFormularioIndSistExterno"/>
                                                <Controls:SinacorLabel Width="75.5"
                                                                   Content="{DynamicResource Bovespa.Ordens.Label.Dolar}"
                                                                   VerticalAlignment="Top"
                                                                   HorizontalContentAlignment="Left"
                                                                   Margin="574,42,0,0"
                                                                   HorizontalAlignment="Left"/>
                                                <Controls:SinacorDecimalTextBox Margin="574,63,0,0"
                                                                     Width="130"
                                                                     HorizontalAlignment="Left"
                                                                     VerticalAlignment="Top"
                                                                     TabIndex="39"
                                                                     IsFormated="True"
                                                                     Integers="4"
                                                                     Decimals="4"
                                                                     AcceptsNegative="False"
                                                                     Value="{Binding OrdemAtual.ValorDolar, UpdateSourceTrigger=PropertyChanged}"
                                                                     x:Name="TxtFormularioValorDolar">
                                                    <Controls:SinacorTextBox.ValidationRules>
                                                        <Validation:EventValidationRule Validating="txtValorDolar_ValidaDolar" />
                                                    </Controls:SinacorTextBox.ValidationRules>
                                                </Controls:SinacorDecimalTextBox>
                                                
                                                <Controls:SinacorCheckBox Width="140"
                                                                      Content="{DynamicResource Bovespa.Ordens.Label.DesprezarSaldo}"
                                                                      HorizontalAlignment="Left"
                                                                      Margin="710,66,0,0"
                                                                      VerticalAlignment="Top"
                                                                      TabIndex="40"
                                                                      IsChecked="{Binding OrdemAtual.IndicadorDesprezaSaldo}"
                                                                      x:Name="ChkFormularioDesprezarSaldo"/>
                                            </Grid>
                                        </Controls:SinacorGroupBox>

                                        <Controls:SinacorGroupBox Header="{DynamicResource Bovespa.Ordens.Label.Observacoes}"
                                                              Width="940"
                                                              Height="107"
                                                              Margin="0,410,0,0"
                                                              HorizontalAlignment="Left"
                                                              VerticalAlignment="Top">
                                            <Grid Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,-8,0,0">
                                                <Controls:SinacorComboBox x:Name="CboFormularioMsgObservacoes"
                                                                  HorizontalAlignment="Left" 							
                                                                  VerticalAlignment="Top" 							
                                                                  Margin="0,4,0,0" 							
                                                                  TabIndex="41"
                                                                  Width="920"                                                                  
                                                                  ItemsSource="{Binding MensagensObservacoes}"
                                                                  SelectedValuePath="Codigo" 
                                                                  DisplayMemberPath="Descricao"
                                                                  WidthPopup="900"/>

                                                <Controls:SinacorTextBox Name="TxtFormularioObservacao"
                                                                 MaxLength="400"
                                                                 TextWrapping="Wrap" 							
                                                                 Margin="2,33,0,0" 							
                                                                 HorizontalAlignment="Left" 							
                                                                 TabIndex="42"
                                                                 VerticalAlignment="Top"
                                                                 Width="919"
                                                                 Height="48"
                                                                 Text="{Binding OrdemAtual.Observacao}"/>
                                            </Grid>
                                        </Controls:SinacorGroupBox>

                                    </Grid>

                                    <Grid Grid.Row="2">
                                        <Controls:SinacorButton HorizontalAlignment="Left"
                                                                VerticalAlignment="Top"
                                                                Margin="632,0,0,0"
                                                                Content="{DynamicResource Bovespa.Ordens.Label.PreBoleto}"
                                                                Width="100"
                                                                TabIndex="43"
                                                                CausesValidation="False"
                                                                IsEnabled="False"
                                                                x:Name="BtnFormularioPreBoleto"/>

                                        <Controls:SinacorButton x:Name="btnSalvarFormulario"
                                                                HorizontalAlignment="Left"
                                                                VerticalAlignment="Top"
                                                                Content="{DynamicResource Bovespa.Ordens.Label.Salvar}"
                                                                Margin="736,0,0,0"
                                                                Width="100"
                                                                TabIndex="44"
                                                                IsDefault="True"
                                                                CausesValidation="True"/>

                                        <Controls:SinacorButton x:Name="BtnCancelarFormulario"                                    
                                                                HorizontalAlignment="Left"
                                                                VerticalAlignment="Top"
                                                                Content="{DynamicResource Bovespa.Ordens.Label.Cancelar}"
                                                                Margin="840,0,0,0"
                                                                Width="100"
                                                                TabIndex="45"
                                                                CausesValidation="False"/>
                                    </Grid>

                                </Grid>
                            </Controls:SinacorExpander>

                            <Controls:SinacorExpander HorizontalAlignment="Stretch"
                                                      VerticalAlignment="Stretch"
                                                      Header="{DynamicResource Bovespa.Ordens.Label.Ordens}"
                                                      IsExpanded="True"
                                                      Grid.Row="0"
                                                      AllowExpand="False"
                                                      x:Name="ExpGridOrdens">
                                <Grid>
                                    <Controls:SinacorDataGrid HorizontalAlignment="Stretch"
                                                          Name="dtgOrdens"
                                                          VerticalAlignment="Stretch"
                                                          Margin="0,0,0,0"
                                                          AllowBeginInsert="False"
                                                          AllowBeginUpdate="True"
                                                          AllowSaveAll="True"
                                                          AllowSave="False"
                                                          AllowUndo="True"
                                                          AllowUndoLast="True"
                                                          AllowUndoAll="True"
                                                          RowEditMode="AllCells"
                                                          ItemsSource="{Binding Ordens}">

                                        <Controls:SinacorDataGrid.ContextMenuTemplate>
                                            <DataTemplate>
                                                <StackPanel>
                                                    <Controls:SinacorContextMenuItem Name="menuFecharOrdem" 
                                                                                 Header="{DynamicResource Bovespa.Ordens.Label.FecharOrdemAdmiConcorr}"
                                                                                 Click="menuFecharOrdem_Click" 
                                                                                 Loaded="menuFecharOrdem_Loaded"/>
                                                    <Controls:SinacorContextMenuItem Name="menuCancelarOrdem"
                                                                                 Header="{DynamicResource Bovespa.ManutencaoOrdens.Label.CancelarOrdem}"
                                                                                 Click="menuCancelarOrdem_Click" 
                                                                                 Loaded="menuCancelarOrdem_Loaded"/>
                                                    <Controls:SinacorContextMenuItemSeparator/>

                                                    <Controls:SinacorContextMenuItem Name="menuPreBoleto"
                                                                                 Header="{DynamicResource Bovespa.Ordens.Label.PreBoleto}"
                                                                                 CausesValidation="False"
                                                                                 Click="menuPreBoleto_Click"
                                                                                 Loaded="menuPreBoleto_Loaded"/>

                                                    <Controls:SinacorContextMenuItemSeparator/>

                                                    <Controls:SinacorContextMenuItem Name="menuObservacoes"
                                                                                 Header="{DynamicResource Bovespa.Ordens.Label.Observacoes}"
                                                                                 CausesValidation="False"
                                                                                 Click="menuObservacoes_Click"
                                                                                 Loaded="menuObservacoes_Loaded"/>

                                                    <Controls:SinacorContextMenuItemSeparator/>

                                                    <Controls:SinacorContextMenuItem Name="menuIncluirGrade"
                                                                                 Header="{DynamicResource Bovespa.Ordens.Label.IncluirGrade}"
                                                                                 IsEnabled="{Binding PresenterManutencaoOrdens.HabilitaInclusaoOrdem}"
                                                                                 Click="menuIncluirGrade_Click" 
                                                                                 Loaded="menuIncluirGrade_Loaded"/>

                                                    <Controls:SinacorContextMenuItem Name="menuIncluirModoFormulario"
                                                                                 Header="{DynamicResource Bovespa.Ordens.Label.IncluirModoFormulario}"
                                                                                 Click="menuIncluirModoFormulario_Click"
                                                                                 Loaded="menuIncluirModoFormulario_Loaded"/>
                                                    <Controls:SinacorContextMenuItemSeparator/>

                                                    <Controls:SinacorContextMenuItem Name="menuAlterarGrade"
                                                                                 Header="{DynamicResource Bovespa.Ordens.Label.AlterarGrade}" 
                                                                                 Click="menuAlterarGrade_Click"
                                                                                 Loaded="menuAlterarGrade_Loaded"/>

                                                    <Controls:SinacorContextMenuItem Name="menuAlterarModoFormulario"
                                                                                 Header="{DynamicResource Bovespa.Ordens.Label.AlterarModoFormulario}"
                                                                                 Click="menuAlterarModoFormulario_Click"
                                                                                 Loaded="menuAlterarModoFormulario_Loaded"/>

                                                </StackPanel>
                                            </DataTemplate>
                                        </Controls:SinacorDataGrid.ContextMenuTemplate>
                                        <Controls:SinacorDataGrid.Columns>
                                            <Controls:Column Name="DataOrdem"
                                                         Title="Bovespa.Ordens.Label.Data"
                                                         HorizontalCellAlignment="Center"
                                                         AllowInsert="False"
                                                         AllowUpdate="False"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="DataOrdem">
                                            </Controls:Column>

                                            <Controls:Column Name="NumeroOrdem"
                                                         Title="Bovespa.Ordens.Label.Numero"
                                                         HorizontalCellAlignment="Right"
                                                         AllowInsert="False"
                                                         AllowUpdate="False"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="NumeroOrdem">
                                            </Controls:Column>

                                            <Controls:Column Name="SubsequenciaOrdem"
                                                         Title="Bovespa.Ordens.Label.Subseq"
                                                         HorizontalCellAlignment="Right"
                                                         AllowInsert="False"
                                                         AllowUpdate="False"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="NumeroOrdemSubSequencia">
                                            </Controls:Column>

                                            <Controls:Column Name="Situacao"
                                                         Title="Bovespa.Ordens.Label.Sit"
                                                         HorizontalCellAlignment="Right"
                                                         AllowInsert="False"
                                                         AllowUpdate="True"
                                                         IsRequired="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="Situacao">
                                            </Controls:Column>

                                            <Controls:Column Name="Cliente"
                                                         Title="Bovespa.Ordens.Label.Cliente"
                                                         HorizontalCellAlignment="Left"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="ApelidoCliente"
                                                         AllowGroup="True">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorTextBox x:Name="txtClienteOrdem" 
                                                                             MaxLength="18" 
                                                                             IsRequired="True" 
                                                                             CharacterCasing="Upper"
                                                                             RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.CodigoClienteObrigatorio"
                                                                             Text="{Binding ApelidoCliente, UpdateSourceTrigger=PropertyChanged}"
                                                                             LostFocus="txtClienteOrdem_LostFocus">
                                                            <Controls:SinacorTextBox.ValidationRules>
                                                                <Validation:EventValidationRule Validating="txtClienteOrdem_ValidaCliente" />
                                                            </Controls:SinacorTextBox.ValidationRules>
                                                        </Controls:SinacorTextBox>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="Digito"
                                                         Title="Bovespa.Ordens.Label.Digito"
                                                         HorizontalCellAlignment="Right"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="DigitoCliente">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorInt32TextBox x:Name="txtInsertDigito"
                                                                                  AcceptsNegative="False"
                                                                                  RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.DigitoVerificadorObrigatorio"
                                                                                  Integers="1"
                                                                                  Value="{Binding DigitoCliente, UpdateSourceTrigger=PropertyChanged}">

                                                            <Controls:SinacorTextBox.ValidationRules>
                                                                <Validation:EventValidationRule Validating="txtInsertDigito_Validating" />
                                                            </Controls:SinacorTextBox.ValidationRules>
                                                        </Controls:SinacorInt32TextBox>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="NaturezaOperacao"
                                                         Title="Bovespa.Ordens.Label.NatOper"
                                                         HorizontalCellAlignment="Left"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="NaturezaOperacao"
                                                         AllowGroup="True">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorComboBox x:Name="cboNatOper"
                                                                              IsRequired="True"
                                                                              RequiredErrorMessage="Bovespa.ManutencaoOrdens.Message.NaturezaOperacaoObrigatorio"
                                                                              ItemsSource="{Binding PresenterManutencaoOrdens.ListaNaturezaOperacao, 
                                                                                                    RelativeSource={RelativeSource FindAncestor, 
                                                                                                    AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                              SelectedValue="{Binding NaturezaOperacao}"
                                                                              WidthPopup="900"/>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="Ativo"
                                                         Title="Bovespa.Ordens.Label.Ativo"
                                                         HorizontalCellAlignment="Left"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="Ativo"
                                                         AllowGroup="True">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorFilteredTextBox x:Name="txtInsertAtivo" 
                                                                                         FilterExpression="^[a-zA-Z0-9]{0,12}$"
                                                                                         MaxLength="12" 
                                                                                         IsRequired="True" 
                                                                                         CharacterCasing="Upper"
                                                                                         RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.AtivoObrigatorioException"
                                                                                         LostFocus="txtAtivo_LostFocus"
                                                                                         Text="{Binding Ativo, UpdateSourceTrigger=PropertyChanged}">
                                                            <Controls:SinacorTextBox.ValidationRules>
                                                                <Validation:EventValidationRule Validating="txtAtivo_ValidaAtivo" />
                                                            </Controls:SinacorTextBox.ValidationRules>
                                                        </Controls:SinacorFilteredTextBox>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="Bolsa"
                                                         Title="Bovespa.Ordens.Label.Bolsa"
                                                         HorizontalCellAlignment="Left"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="NomeBolsa"
                                                         AllowGroup="True">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorComboBox x:Name="cboBolsa"                                                                              
                                                                              ItemsSource="{Binding PresenterManutencaoOrdens.Bolsas, 
                                                                                                    RelativeSource={RelativeSource FindAncestor, 
                                                                                                    AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                              DisplayMemberPath="Descricao"
                                                                              SelectedValuePath="Codigo"
                                                                              SelectedValue="{Binding CodigoBolsa}"
                                                                              SelectionChanged="cboBolsa_SelectionChanged"
                                                                              WidthPopup="900"/>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="Quantidade"
                                                         Title="Bovespa.Ordens.Label.Quantidade"
                                                         HorizontalCellAlignment="Right"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="Quantidade"                                                         
                                                         StringFormat="n4">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorDecimalTextBox x:Name="txtInsertQuantidade"
                                                                                    AcceptsNegative="False"                                                                                    
                                                                                    Integers="12" 
                                                                                    Decimals="4" 
                                                                                    IsFormated="True"
                                                                                    PreviewKeyDown="txtQuantidade_PreviewKeyDown"
                                                                                    Value="{Binding Quantidade, UpdateSourceTrigger=PropertyChanged}">
                                                            <Controls:SinacorTextBox.ValidationRules>
                                                                <Validation:EventValidationRule Validating="txtQuantidade_ValidaQuantidade" />
                                                            </Controls:SinacorTextBox.ValidationRules>
                                                        </Controls:SinacorDecimalTextBox>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="TipoLiquidacao"
                                                         Title="Bovespa.Ordens.Label.TipoLiquidacao1"
                                                         HorizontalCellAlignment="Left"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         IsRequired="True"
                                                         RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.TipoLiquidacaoObrigatorio"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="TipoLiquidacao"
                                                         Width="100">
                                            </Controls:Column>

                                            <Controls:Column Name="Carteira"
                                                         Title="Bovespa.Ordens.Label.Carteira"
                                                         HorizontalCellAlignment="Right"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="Carteira">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorInt32TextBox x:Name="txtInsertCarteira" 
                                                                                  Integers="3" 
                                                                                  IsFormated="False"
                                                                                  Value="{Binding Carteira, UpdateSourceTrigger=PropertyChanged}"/>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="PercAcrescimoReducao"
                                                         Title="Bovespa.Ordens.Label.PercAcrRed"
                                                         StringFormat="n8"
                                                         HorizontalCellAlignment="Right"
                                                         AllowInsert="False"
                                                         AllowUpdate="False"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="PercentualCorretagem">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorDecimalTextBox x:Name="txtPercAcrescimoReducao" 
                                                                                 Decimals="8"
                                                                                 Integers="4"
                                                                                 IsFormated="True"
                                                                                 IsRequired="True"
                                                                                 AcceptsNegative="True"
                                                                                 RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.PercentualCorretagemObrigatorio"
                                                                                 Value="{Binding PercentualCorretagem}"/>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="Broker"
                                                         Title="Bovespa.Ordens.Label.Broker"
                                                         HorizontalCellAlignment="Left"
                                                         AllowInsert="False"
                                                         AllowUpdate="False"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="CodigoBrokerCliente">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorTextBox x:Name="txtInsertBroker" 
                                                                             MaxLength="20" 
                                                                             Text="{Binding CodigoBrokerCliente, UpdateSourceTrigger=PropertyChanged}"/>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="QuantidadeCasada"
                                                         Title="Bovespa.Ordens.Label.QtdCasada"
                                                         HorizontalCellAlignment="Right"
                                                         AllowInsert="False"
                                                         AllowUpdate="False"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="QuantidadeExecutada" Decimals="4" Integers="13" StringFormat="n4">
                                            </Controls:Column>

                                            <Controls:Column Name="Preco"
                                                         Title="Bovespa.Ordens.Label.Preco"
                                                         HorizontalCellAlignment="Right"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="Preco"
                                                         StringFormat="n4">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorDecimalTextBox Integers="12" 
                                                                                    Decimals="4" 
                                                                                    IsFormated="True"                                                                                     
                                                                                    AcceptsNegative="False"                                                                                    
                                                                                    Value="{Binding Preco, UpdateSourceTrigger=PropertyChanged}"/>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="Validade"
                                                         Title="Bovespa.Ordens.Label.Validade"
                                                         HorizontalCellAlignment="Center"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="DataValidade">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorDatePicker Value="{Binding DataValidade}" />
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="Discricionaria"
                                                         Title="Bovespa.Ordens.Label.Discr"
                                                         HorizontalCellAlignment="Center"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="Discricionaria"
                                                         AllowGroup="True">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorCheckBox x:Name="chkInsertDiscricionaria" 
                                                                              IsChecked="{Binding Discricionaria}" />
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="Tipo"
                                                         Title="Bovespa.Ordens.Label.Tipo"
                                                         HorizontalCellAlignment="Left"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="TipoOrdem"
                                                         AllowGroup="True">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorComboBox x:Name="cboTiposOrdens"
                                                                              IsRequired="True"
                                                                              RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.TipoOrdemObrigatorio"
                                                                              ItemsSource="{Binding PresenterManutencaoOrdens.TiposOrdens,
                                                                                RelativeSource={RelativeSource FindAncestor, 
                                                                                    AncestorType={x:Type Controls:SinacorWindow}}}"                                                                              
                                                                              SelectionChanged="cboTiposOrdens_SelectionChanged"
                                                                              SelectedValue="{Binding TipoOrdem}"
                                                                              WidthPopup="900"
                                                                              />
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="PrecoMedio"
                                                             Title="Bovespa.ManutencaoOrdens.Label.PrecoMedio"
                                                             AllowInsert="False"
                                                             AllowUpdate="False"
                                                             DisplayMemberPath="PrecoMedio"
                                                             StringFormat="N4"
                                                             AllowGroup="True">
                                            </Controls:Column>

                                            <Controls:Column Name="Volume"
                                                             Title="Bovespa.ManutencaoOrdens.Label.Volume"
                                                             AllowInsert="False"
                                                             AllowUpdate="False"
                                                             DisplayMemberPath="Volume"
                                                             StringFormat="N4">
                                            </Controls:Column>

                                            <Controls:Column Name="QtdeAnexoIV"
                                                         Title="Bovespa.Ordens.Label.QuantidadeAnexo4"
                                                         HorizontalCellAlignment="Right"  Decimals="4" Integers="17" StringFormat="n4"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="QuantidadeAnexoIV">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorDecimalTextBox x:Name="txtInsertQtdeAnexoIV"
                                                                                    Integers="12"
                                                                                    Decimals="4"
                                                                                    IsFormated="True"
                                                                                    Value="{Binding QuantidadeAnexoIV, UpdateSourceTrigger=PropertyChanged}"/>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="QtdeAnexoV"
                                                         Title="Bovespa.Ordens.Label.QuantidadeAnexo5"
                                                         HorizontalCellAlignment="Right" Decimals="4" Integers="17" StringFormat="n4"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="QuantidadeAnexoV">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorDecimalTextBox x:Name="txtInsertQtdeAnexoV"
                                                                                    Integers="12"
                                                                                    Decimals="4"
                                                                                    IsFormated="True"
                                                                                    Value="{Binding QuantidadeAnexoV, UpdateSourceTrigger=PropertyChanged}"/>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="IndicadorSistemaExterno"
                                                         Title="Bovespa.Ordens.Label.IndSistExterno"
                                                         HorizontalCellAlignment="Left"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="IndicadorSistemaExterno" MaxLength="18">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorTextBox x:Name="txtInsertIndicSistExt" 
                                                                             Text="{Binding IndicadorSistemaExterno, UpdateSourceTrigger=PropertyChanged}" MaxLength="18"/>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="Emissor"
                                                         Title="Bovespa.Ordens.Label.Emissor"
                                                         HorizontalCellAlignment="Left"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="NomeEmissor">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorComboBox x:Name="CmbEmissor"
                                                                              ItemsSource="{Binding PresenterManutencaoOrdens.Emissores, 
                                                                                                    RelativeSource={RelativeSource FindAncestor, 
                                                                                                    AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                              DisplayMemberPath="Nome"
                                                                              SelectedValuePath="Nome"
                                                                              SelectedValue="{Binding NomeEmissor}"
                                                                              WidthPopup="900"/>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="Operador"
                                                         Title="Bovespa.Ordens.Label.Operador"
                                                         HorizontalCellAlignment="Left"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="LoginOperador">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorComboBox x:Name="CboOperador"
                                                                              IsRequired="True"
                                                                              RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.OperadorObrigatorio"
                                                                              
                                                                              ItemsSource="{Binding PresenterManutencaoOrdens.OperadoresSubordinadosGrid, 
                                                                                                    RelativeSource={RelativeSource FindAncestor, 
                                                                                                    AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                              SelectedValuePath="CodigoOperador" 
                                                                              DisplayMemberPath="LoginOperador" 
                                                                              SelectedValue="{Binding CodigoOperador}"                                                                              
                                                                              SelectionChanged="CboOperador_SelectionChanged"
                                                                              WidthPopup="900"    />
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="ValorFinanciamento"
                                                         Title="Bovespa.Ordens.Label.ValorFinanc"
                                                         HorizontalCellAlignment="Right"  Decimals="4" Integers="16" StringFormat="n4"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="ValorFinanciamento">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorDecimalTextBox x:Name="txtInsertValorFinanciamento"
                                                                                    Integers="13"
                                                                                    Decimals="2"
                                                                                    AcceptsNegative="False"
                                                                                    RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.ValorFinanciamentoInvalido"
                                                                                    Value="{Binding ValorFinanciamento, UpdateSourceTrigger=PropertyChanged}"/>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="PercFinanciamento"
                                                         Title="Bovespa.Ordens.Label.PercFinanc"
                                                         HorizontalCellAlignment="Right" Decimals="6" Integers="5" StringFormat="n6"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="PercentualFinanciamento">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorDecimalTextBox x:Name="txtInsertPercFinanciamento"
                                                                                    Integers="4"
                                                                                    Decimals="6"
                                                                                    IsFormated="True"
                                                                                    AcceptsNegative="False"
                                                                                    RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.PercentualFinanciamentoInvalido"
                                                                                    Value="{Binding PercentualFinanciamento, UpdateSourceTrigger=PropertyChanged}"/>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="VencimentoTermo"
                                                         Title="Bovespa.Ordens.Label.VenctoTermo"
                                                         HorizontalCellAlignment="Center"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="PrazoVencimentoTermo">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorInt32TextBox x:Name="txtInsertVencimentoTermo"
                                                                                  Integers="5"
                                                                                  IsFormated="True"
                                                                                  RequiredErrorMessage="Bovespa.Ordens.ExceptionMessage.VencimentoTermoInvalido"
                                                                                  Value="{Binding PrazoVencimentoTermo, UpdateSourceTrigger=PropertyChanged}"/>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="Mercado"
                                                         Title="Bovespa.Ordens.Label.Mercado"
                                                         HorizontalCellAlignment="Left"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="Mercado"
                                                         AllowGroup="True">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorComboBox x:Name="cboTiposMercados"
                                                                              ItemsSource="{Binding PresenterManutencaoOrdens.TiposMercados,
                                                                                RelativeSource={RelativeSource FindAncestor, 
                                                                                    AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                              SelectionChanged="cboTiposMercados_SelectionChanged"
                                                                              SelectedValue="{Binding Mercado}"
                                                                              WidthPopup="900"/>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="OrdemOriginal"
                                                         Title="Bovespa.Ordens.Label.OrdOriginal"
                                                         HorizontalCellAlignment="Right"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="NumeroOrdemOriginal">
                                                <Controls:Column.CellInsertTemplate>
                                                    <DataTemplate>
                                                        <Controls:SinacorInt32TextBox x:Name="txtInsertOrdemOriginal"
                                                                                  Integers="9"
                                                                                  IsFormated="True"
                                                                                  Value="{Binding NumeroOrdemOriginal, UpdateSourceTrigger=PropertyChanged}"/>
                                                    </DataTemplate>
                                                </Controls:Column.CellInsertTemplate>
                                            </Controls:Column>

                                            <Controls:Column Name="AdministradoConcorrente"
                                                         Title="Bovespa.Ordens.Label.AdmConc"
                                                         HorizontalCellAlignment="Center"
                                                         AllowInsert="False"
                                                         AllowUpdate="False"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="IndicadorOrdemAdmConcorrente">
                                            </Controls:Column>

                                            <Controls:Column Name="PessoaVinculada"
                                                         Title="Bovespa.Ordens.Label.PesVinc"
                                                         HorizontalCellAlignment="Center"
                                                         AllowInsert="False"
                                                         AllowUpdate="False"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="IndicadorClientePessoaVinculada">
                                            </Controls:Column>

                                            <Controls:Column Name="DesprezarSaldo"
                                                         Title="Bovespa.Ordens.Label.DesprezarSaldo"
                                                         HorizontalCellAlignment="Center"
                                                         AllowInsert="True"
                                                         AllowUpdate="True"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="IndicadorDesprezaSaldo">
                                            </Controls:Column>

                                        </Controls:SinacorDataGrid.Columns>
                                    </Controls:SinacorDataGrid>

                                </Grid>
                            </Controls:SinacorExpander>

                        </Controls:SinacorExpanderContainer>
                    </Controls:SinacorScrollViewer>
                </Grid>
            </Controls:SinacorTabItem>
            <!-- TAB JUSTIFICATIVAS -->
            <Controls:SinacorTabItem Header="{DynamicResource Bovespa.ManutencaoOrdens.Label.Justificativas}" Name="tabJustificativas">
                <Controls:SinacorExpanderContainer>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="5" />
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <Controls:SinacorExpander HorizontalAlignment="Stretch" 			
                                                  VerticalAlignment="Stretch" 			
                                                  Header="{DynamicResource Bovespa.ManutencaoOrdens.Label.JustificativasRecentes}" 			
                                                  IsExpanded="True" 			
                                                  AllowExpand="False"
                                                  Height="Auto"
                                                  Width="Auto"
												  Grid.Row="0">
                        
                        <Grid Width="Auto" Height="Auto">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="5" />
                                <RowDefinition Height="120"/>
                            </Grid.RowDefinitions>
                            <Controls:SinacorDataGrid AllowBeginInsert="False" 							
                                                              AllowBeginUpdate="True" 							
                                                              AllowCancelInsert="False" 							
                                                              AllowCancelUpdate="True" 							
                                                              AllowEndInsert="False" 							
                                                              AllowEndUpdate="True" 							
                                                              AllowSave="False" 							
                                                              AllowSaveAll="False" 							
                                                              AllowUndo="False" 							
                                                              AllowUndoAll="False" 							
                                                              AllowUndoLast="False"
                                                              RowEditMode="AllCells" 							
                                                              SelectionMode="Extended"
                                                              VerticalAlignment="Stretch"
                                                              HorizontalAlignment="Stretch"
                                                              ItemsSource="{Binding JustificativasRecente}"
                                                              Name="DtgJustificativasRecente"
                                                              Width="Auto"
                                                              Height="Auto"
                                                              Margin="0,0,0,0"
                                                              Grid.Row="0">
                                        <Controls:SinacorDataGrid.Columns>

                                            <Controls:Column Name="Data"																	
                                                             Title="Bovespa.Ordens.Label.Data" 									
                                                             HorizontalCellAlignment="Center"
                                                             DisplayMemberPath="DataOrdem"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}">
                                            </Controls:Column>

                                            <Controls:Column Name="Numero"
                                                             Title="Bovespa.Ordens.Label.Numero" 									
                                                             HorizontalCellAlignment="Right"
                                                             DisplayMemberPath="NumeroOrdem"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}">
                                            </Controls:Column>
                                            <Controls:Column Name="SubSeq" 																
                                                             Title="Bovespa.Ordens.Label.Subseq" 									
                                                             HorizontalCellAlignment="Right"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                             DisplayMemberPath="NumeroSubSequenciaOrdem">
                                            </Controls:Column>
                                            <Controls:Column Name="Apelido" 																
                                                             HorizontalCellAlignment="Left"
                                                             Title="Bovespa.Ordens.Label.Apelido" 									
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                             DisplayMemberPath="ApelidoCliente">
                                            </Controls:Column>
                                            <Controls:Column Name="NatOper" 									
                                                             Title="Bovespa.Ordens.Label.NatOper" 									
                                                             HorizontalCellAlignment="Right"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                             DisplayMemberPath="NaturezaOperacao">
                                            </Controls:Column>

                                            <Controls:Column Name="Ativo" 									
                                                             Title="Bovespa.Ordens.Label.Ativo" 									
                                                             HorizontalCellAlignment="Left"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                             DisplayMemberPath="Ativo">
                                            </Controls:Column>
                                            <Controls:Column Name="NumJust" 									
                                                             Title="Bovespa.Ordens.Label.NumJust" 									
                                                             HorizontalCellAlignment="Right"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                             DisplayMemberPath="Codigo">
                                            </Controls:Column>
                                            <Controls:Column Name="DataHora" 									
                                                             Title="Bovespa.Ordens.Label.JustificativaDataHora" 									
                                                             HorizontalCellAlignment="Center"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                             DisplayMemberPath="DataAlteracao">
                                            </Controls:Column>
                                            <Controls:Column Name="Justificativa" 									
                                                             Title="Bovespa.Ordens.Label.Justificativa" 									
                                                             HorizontalCellAlignment="Left"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                             DisplayMemberPath="JustificativaOrdem"
                                                             AllowInsert="False"
                                                             AllowUpdate="False"
                                                             MaxLength="120">
                                            </Controls:Column>
                                        </Controls:SinacorDataGrid.Columns>
                                    </Controls:SinacorDataGrid>
                                    <Controls:SinacorGroupBox HorizontalAlignment="Stretch"
                                                              VerticalAlignment="Stretch"
                                                              Width="Auto"
                                                              Header="{DynamicResource Bovespa.ManutencaoOrdens.Label.Justificativa}"
                                                              Height="Auto"
                                                              Grid.Row="2">
                                <Grid Height="Auto" VerticalAlignment="Stretch">
                                    <Controls:SinacorComboBox VerticalAlignment="Top" 							
                                                              IsRequired="False"						
                                                              Margin="0,0,0,0"						
                                                              TabIndex="3"
                                                              Width="941"
                                                              HorizontalAlignment="Left"
                                                              ItemsSource="{Binding MensagensJustificativas}"
                                                              SelectedValuePath="Codigo" 
                                                              DisplayMemberPath="Descricao"
                                                              IsEnabled="False"
                                                              x:Name="CboJustificativasRecente"/>

                                    <Controls:SinacorTextBox TextWrapping="Wrap" 							
                                                             Height="48" 							
                                                             Width="941" 							
                                                             TabIndex="4"
                                                             MaxLength="120"
                                                             VerticalAlignment="Top"
                                                             HorizontalAlignment="Left"
                                                             Margin="0,25,0,0"
                                                             IsEnabled="False"
                                                             x:Name="TxtJustificativasRecente"/>
                                    
                                    <Controls:SinacorButton x:Name="BtnSalvarJustificativaRecente"
                                                                HorizontalAlignment="Left"
                                                                VerticalAlignment="Top"
                                                                Content="{DynamicResource Bovespa.Ordens.Label.Salvar}"
                                                                Margin="839,75,0,0"
                                                                Width="100"
                                                                TabIndex="5"/>
                               
                                </Grid>
                            </Controls:SinacorGroupBox>
                        </Grid>
                    </Controls:SinacorExpander>

                    <Controls:SinacorExpander HorizontalAlignment="Stretch" 			
                                              VerticalAlignment="Stretch" 			
                                              Header="{DynamicResource Bovespa.ManutencaoOrdens.Label.JustificativasHistorico}" 			
                                              IsExpanded="True" 			
                                              AllowExpand="False"
                                              Height="Auto"
										      Grid.Row="2">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="5" />
                                <RowDefinition Height="120"/>
                            </Grid.RowDefinitions>
                            
                                    <Controls:SinacorDataGrid AllowBeginInsert="False" 							
                                                              AllowBeginUpdate="True" 							
                                                              AllowCancelInsert="False" 							
                                                              AllowCancelUpdate="True" 							
                                                              AllowEndInsert="False" 							
                                                              AllowEndUpdate="True" 							
                                                              AllowSave="False" 							
                                                              AllowSaveAll="False" 							
                                                              AllowUndo="True" 							
                                                              AllowUndoAll="True" 							
                                                              AllowUndoLast="True" 							
                                                              RowEditMode="AllCells" 							
                                                              SelectionMode="Extended"
                                                              VerticalAlignment="Stretch"
                                                              HorizontalAlignment="Stretch"
                                                              ItemsSource="{Binding JustificativasHistorico}"
                                                              x:Name="DtgJustificativasHistorico"
                                                              Grid.Row="0">
                                        <Controls:SinacorDataGrid.Columns>

                                            <Controls:Column Name="Data"																	
                                                             Title="Bovespa.Ordens.Label.Data" 									
                                                             HorizontalCellAlignment="Center"
                                                             DisplayMemberPath="DataOrdem"
                                                             AllowGroup="True"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}">
                                            </Controls:Column>

                                            <Controls:Column Name="Numero"
                                                             Title="Bovespa.Ordens.Label.Numero" 									
                                                             HorizontalCellAlignment="Right"
                                                             DisplayMemberPath="NumeroOrdem"
                                                             AllowGroup="True"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}">
                                            </Controls:Column>
                                            <Controls:Column Name="SubSeq" 																
                                                             Title="Bovespa.Ordens.Label.Subseq" 									
                                                             HorizontalCellAlignment="Right"
                                                             AllowGroup="True"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                             DisplayMemberPath="NumeroSubSequenciaOrdem">
                                            </Controls:Column>
                                            <Controls:Column Name="Apelido" 																
                                                             HorizontalCellAlignment="Left"
                                                             Title="Bovespa.Ordens.Label.Apelido" 									
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                             DisplayMemberPath="ApelidoCliente">
                                            </Controls:Column>
                                            <Controls:Column Name="NatOper" 									
                                                             Title="Bovespa.Ordens.Label.NatOper" 									
                                                             HorizontalCellAlignment="Right"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                             DisplayMemberPath="NaturezaOperacao">
                                            </Controls:Column>

                                            <Controls:Column Name="Ativo" 									
                                                             Title="Bovespa.Ordens.Label.Ativo" 									
                                                             HorizontalCellAlignment="Left"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                             DisplayMemberPath="Ativo">
                                            </Controls:Column>
                                            <Controls:Column Name="NumJust" 									
                                                             Title="Bovespa.Ordens.Label.NumJust" 									
                                                             HorizontalCellAlignment="Right"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                             DisplayMemberPath="Codigo">
                                            </Controls:Column>
                                            <Controls:Column Name="DataHora" 									
                                                             Title="Bovespa.Ordens.Label.JustificativaDataHora" 									
                                                             HorizontalCellAlignment="Center"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                             DisplayMemberPath="DataAlteracao">
                                            </Controls:Column>
                                            <Controls:Column Name="Justificativa" 									
                                                             Title="Bovespa.Ordens.Label.Justificativa" 									
                                                             HorizontalCellAlignment="Left"
                                                             CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                             DisplayMemberPath="JustificativaOrdem"
                                                             AllowInsert="False"
                                                             AllowUpdate="False"
                                                             MaxLength="120">
                                            </Controls:Column>
                                        </Controls:SinacorDataGrid.Columns>
                                    </Controls:SinacorDataGrid>
                                    <Controls:SinacorGroupBox HorizontalAlignment="Stretch"
                                                      VerticalAlignment="Stretch"
                                                      Width="Auto"
                                                      Header="{DynamicResource Bovespa.ManutencaoOrdens.Label.Justificativa}"
                                                      Height="Auto"
                                                      Grid.Row="2">
                                    <Grid Height="Auto">
                                    <Controls:SinacorComboBox VerticalAlignment="Top" 							
                                                              IsRequired="False"
                                                              Margin="0,0,0,0" 							
                                                              TabIndex="6"
                                                              Width="941"
                                                              HorizontalAlignment="Left"
                                                              ItemsSource="{Binding MensagensJustificativas}"
                                                              SelectedValuePath="Codigo" 
                                                              DisplayMemberPath="Descricao"
                                                              IsEnabled="False"
                                                              x:Name="CboJustificativasHistorico"/>

                                    <Controls:SinacorTextBox TextWrapping="Wrap" 							
                                                             Height="48" 							
                                                             Width="941" 							
                                                             TabIndex="7"
                                                             MaxLength="120"
                                                             VerticalAlignment="Top"
                                                             HorizontalAlignment="Left"
                                                             Margin="0,25,0,0"
                                                             IsEnabled="False"
                                                             x:Name="TxtJustificativasHistorico"/>
                                    
                                    <Controls:SinacorButton x:Name="BtnSalvarJustificativaHistorico"
                                                                HorizontalAlignment="Left"
                                                                VerticalAlignment="Top"
                                                                Content="{DynamicResource Bovespa.Ordens.Label.Salvar}"
                                                                Margin="839,75,0,0"
                                                                Width="100"
                                                                TabIndex="8"/>
                                </Grid>
                            </Controls:SinacorGroupBox>
                        </Grid>
                    </Controls:SinacorExpander>

                </Controls:SinacorExpanderContainer>
            </Controls:SinacorTabItem>
            <!-- TAB FINANCIAMENTO/POP -->
            <Controls:SinacorTabItem Header="{DynamicResource Bovespa.Ordens.Label.TipoEstrategiaPOP}" Name="tabFinanciamentoPop">
                <Grid x:Name="gridEstrategia">
                    <Controls:SinacorExpanderContainer>
                        <Controls:SinacorExpander HorizontalAlignment="Stretch"
                                                  VerticalAlignment="Stretch"
                                                  Header="{DynamicResource Bovespa.Ordens.Label.TipoEstrategiaPOP}"
                                                  Height="Auto"
                                                  IsExpanded="True"
                                                  AllowExpand="False">
                            <Grid HorizontalAlignment="Stretch"
                                  VerticalAlignment="Stretch">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="5" />
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Controls:SinacorDataGrid HorizontalAlignment="Stretch"
                                                          Width="Auto"
                                                          IsSynchronizedWithCurrentItem="True"
                                                          VerticalAlignment="Stretch"
                                                          Margin="0,0,0,0"
                                                          AllowBeginInsert="True"
                                                          AllowBeginUpdate="True"
                                                          AllowCancelInsert="True"
                                                          AllowCancelUpdate="True"
                                                          AllowEndInsert="True"
                                                          AllowEndUpdate="True"
                                                          AllowSave="False"
                                                          AllowSaveAll="False"
                                                          AllowUndo="True"
                                                          AllowDelete="True"
                                                          AllowUndoAll="True"
                                                          RowEditMode="AllCells"
                                                          ItemsSource="{Binding OrdemAtual.Detalhes}"
                                                          Name="DtgDetalhes">
                                    <Controls:SinacorDataGrid.ContextMenuTemplate>
                                        <DataTemplate>
                                            <StackPanel>
                                                <Controls:SinacorContextMenuItem Name="menuCasamento"
                                                                                 Header="{DynamicResource Bovespa.Ordens.Label.Casamento}" 
                                                                                 Click="menuCasamento_Click" 
                                                                                 Loaded="menuCasamento_Loaded" />
                                                <Controls:SinacorContextMenuItem Name="menuPreBoletoDetalhes"
                                                                                 Header="{DynamicResource Bovespa.Ordens.Label.PreBoleto}"
                                                                                 CausesValidation="False"
                                                                                 Click="menuPreBoletoFinanciamentoPOP_Click"
                                                                                 Loaded="menuPreBoletoFinanciamentoPOP_Loaded"/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </Controls:SinacorDataGrid.ContextMenuTemplate>
                                    <Controls:SinacorDataGrid.Columns>
                                        <Controls:Column Name="Data"
                                                         AllowInsert="False"
                                                         AllowUpdate="False"
                                                         Title="Bovespa.Ordens.Label.Data" 									
                                                         HorizontalCellAlignment="Center"                                                         
                                                         DisplayMemberPath="DataOrdem"/>

                                        <Controls:Column Name="Numero"
                                                         AllowInsert="False"
                                                         AllowUpdate="False"
                                                         Title="Bovespa.Ordens.Label.Numero" 									
                                                         HorizontalCellAlignment="Right"                                                         
                                                         DisplayMemberPath="NumeroOrdem"/>

                                        <Controls:Column Name="SubSeq"
                                                         AllowInsert="False"
                                                         AllowUpdate="False"
                                                         Title="Bovespa.Ordens.Label.Subseq" 									
                                                         HorizontalCellAlignment="Right"                                                         
                                                         DisplayMemberPath="NumeroOrdemSubSequencia"/>

                                        <Controls:Column Name="NatOper"
                                                         AllowInsert="True"
                                                         AllowUpdate="False"
                                                         Title="Bovespa.Ordens.Label.NatOper"
                                                         HorizontalCellAlignment="Left"                                                         
                                                         DisplayMemberPath="NaturezaOperacao"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}">

                                            <Controls:Column.CellInsertTemplate>
                                                <DataTemplate>
                                                    <Controls:SinacorComboBox x:Name="CmbNaturezaOperacao"
                                                                              IsRequired="True"
                                                                              RequiredErrorMessage="Bovespa.ManutencaoOrdens.Message.NaturezaOperacaoObrigatorio"                                                                              
                                                                              ItemsSource="{Binding PresenterManutencaoOrdens.ListaNaturezaOperacaoDetalhe, 
                                                                                                    RelativeSource={RelativeSource FindAncestor, 
                                                                                                    AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                              SelectedValue="{Binding NaturezaOperacao}"/>
                                                </DataTemplate>
                                            </Controls:Column.CellInsertTemplate>
                                        </Controls:Column>

                                        <Controls:Column Name="Ativo"
                                                         AllowInsert="True"
                                                         AllowUpdate="False"
                                                         Title="Bovespa.Ordens.Label.Ativo"
                                                         HorizontalCellAlignment="Left"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="Ativo">

                                            <Controls:Column.CellInsertTemplate>
                                                <DataTemplate>
                                                    <Controls:SinacorFilteredTextBox x:Name="TxtAtivo" 
                                                                                     FilterExpression="^[a-zA-Z0-9]{0,12}$"
                                                                                     MaxLength="12" 
                                                                                     IsRequired="True" 
                                                                                     CharacterCasing="Upper"
                                                                                     RequiredErrorMessage="Bovespa.ManutencaoOrdens.ExceptionMessage.AtivoObrigatorioException"                                                                                     
                                                                                     Text="{Binding Ativo}">

                                                        <Controls:SinacorTextBox.ValidationRules>
                                                            <Validation:EventValidationRule Validating="TxtAtivo_Validating" />
                                                        </Controls:SinacorTextBox.ValidationRules>
                                                    </Controls:SinacorFilteredTextBox>
                                                </DataTemplate>
                                            </Controls:Column.CellInsertTemplate>
                                        </Controls:Column>

                                        <Controls:Column Name="Mercado"
                                                         AllowInsert="True"
                                                         AllowUpdate="False"
                                                         Title="Bovespa.Ordens.Label.Mercado"
                                                         HorizontalCellAlignment="Left"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="Mercado">

                                            <Controls:Column.CellInsertTemplate>
                                                <DataTemplate>
                                                    <Controls:SinacorComboBox x:Name="CmbMercado"
                                                                              IsRequired="True"                                                                              
                                                                              ItemsSource="{Binding PresenterManutencaoOrdens.TiposMercadosDetalhes,
                                                                                                    RelativeSource={RelativeSource FindAncestor, 
                                                                                                    AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                              SelectedValue="{Binding Mercado}"/>
                                                </DataTemplate>
                                            </Controls:Column.CellInsertTemplate>
                                        </Controls:Column>

                                        <Controls:Column Name="VencimentoTermo"
                                                         AllowInsert="True"
                                                         AllowUpdate="False"
                                                         Title="Bovespa.Ordens.Label.VenctoTermo"
                                                         HorizontalCellAlignment="Right"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="PrazoVencimentoTermo">

                                            <Controls:Column.CellInsertTemplate>
                                                <DataTemplate>
                                                    <Controls:SinacorInt32TextBox x:Name="TxtVencimentoTermo"
                                                                                  Integers="5"
                                                                                  IsFormated="True"                                                                                  
                                                                                  Value="{Binding PrazoVencimentoTermo}">
                                                        <Controls:SinacorTextBox.ValidationRules>
                                                            <Validation:EventValidationRule Validating="TxtVencimentoTermo_Validating" />
                                                        </Controls:SinacorTextBox.ValidationRules>
                                                    </Controls:SinacorInt32TextBox>
                                                </DataTemplate>
                                            </Controls:Column.CellInsertTemplate>
                                        </Controls:Column>

                                        <Controls:Column Name="Quantidade"
                                                         AllowInsert="True"
                                                         AllowUpdate="False"
                                                         Title="Bovespa.Ordens.Label.Quantidade"
                                                         HorizontalCellAlignment="Right"                                                         
                                                         StringFormat="n4"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="Quantidade">

                                            <Controls:Column.CellInsertTemplate>
                                                <DataTemplate>
                                                    <Controls:SinacorDecimalTextBox x:Name="TxtQuantidade"                                                                                    
                                                                                    AcceptsNegative="False"                                                                                    
                                                                                    Integers="12" 
                                                                                    Decimals="4" 
                                                                                    IsFormated="True"                                                                                    
                                                                                    Value="{Binding Quantidade}">
                                                        <Controls:SinacorTextBox.ValidationRules>
                                                            <Validation:EventValidationRule Validating="TxtQuantidade_Validating" />
                                                        </Controls:SinacorTextBox.ValidationRules>
                                                    </Controls:SinacorDecimalTextBox>
                                                </DataTemplate>
                                            </Controls:Column.CellInsertTemplate>
                                        </Controls:Column>

                                        <Controls:Column Name="Preco"
                                                         AllowInsert="True"
                                                         AllowUpdate="False"
                                                         Title="Bovespa.Ordens.Label.Preco"
                                                         HorizontalCellAlignment="Right"
                                                         StringFormat="n4"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="Preco">

                                            <Controls:Column.CellInsertTemplate>
                                                <DataTemplate>
                                                    <Controls:SinacorDecimalTextBox x:Name="TxtPreco"
                                                                                    Integers="12" 
                                                                                    Decimals="4" 
                                                                                    IsFormated="True"                                                                                    
                                                                                    AcceptsNegative="False"                                                                                    
                                                                                    RequiredErrorMessage=""
                                                                                    Value="{Binding Preco}">
                                                        <Controls:SinacorTextBox.ValidationRules>
                                                            <Validation:EventValidationRule Validating="TxtPreco_Validating" />
                                                        </Controls:SinacorTextBox.ValidationRules>
                                                    </Controls:SinacorDecimalTextBox>
                                                </DataTemplate>
                                            </Controls:Column.CellInsertTemplate>
                                        </Controls:Column>

                                        <Controls:Column Name="Carteira"
                                                         AllowInsert="True"
                                                         AllowUpdate="False"
                                                         Title="Bovespa.Ordens.Label.Carteira"
                                                         HorizontalCellAlignment="Right"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="Carteira">

                                            <Controls:Column.CellInsertTemplate>
                                                <DataTemplate>
                                                    <Controls:SinacorInt16TextBox Integers="3" 
                                                                                  IsFormated="False"
                                                                                  AcceptsNegative="False"
                                                                                  Value="{Binding Carteira, UpdateSourceTrigger=PropertyChanged}"/>
                                                </DataTemplate>
                                            </Controls:Column.CellInsertTemplate>
                                        </Controls:Column>

                                        <Controls:Column Name="QuantidadeCasada"
                                                         AllowInsert="False"
                                                         AllowUpdate="False"
                                                         Title="Bovespa.Ordens.Label.QtdCasada"
                                                         HorizontalCellAlignment="Right"
                                                         StringFormat="n4"
                                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                                         DisplayMemberPath="QuantidadeExecutada"/>
                                    </Controls:SinacorDataGrid.Columns>

                                </Controls:SinacorDataGrid>
                                <Grid Grid.Row="2">
                                    <Controls:SinacorButton HorizontalAlignment="Left"
                                                            VerticalAlignment="Top"
                                                            Margin="0,0,0,0"
                                                            Content="{DynamicResource Bovespa.Ordens.Label.PreBoleto}"
                                                            Width="99"
                                                            TabIndex="2"
                                                            IsEnabled="False"
                                                            x:Name="btnPreBoletoFinanciamentoPOP"/>

                                    <Controls:SinacorLabel HorizontalAlignment="Left"
                                                           Content="{DynamicResource Bovespa.Ordens.Label.TotalCompra}"
                                                           VerticalAlignment="Top"
                                                           Margin="104,0,0,0"
                                                           Width="95"/>

                                    <Controls:SinacorDecimalTextBox HorizontalAlignment="Left"
                                                             VerticalAlignment="Top"
                                                             Margin="203,0,0,0"
                                                             Width="128"
                                                             TabIndex="3" Decimals="4" Integers="16" IsFormated="True"
                                                             Name="txtSumarizacaoCompra"
                                                             Value="{Binding QuantidadeSumarizada.TotalCompra}"
                                                             IsReadOnly="True"/>

                                    <Controls:SinacorLabel Margin="335,0,0,0"
                                                           VerticalAlignment="Top"
                                                           Content="{DynamicResource Bovespa.Ordens.Label.TotalVenda}"
                                                           HorizontalAlignment="Left"
                                                           Width="95"/>

                                    <Controls:SinacorDecimalTextBox HorizontalAlignment="Left" Decimals="4" Integers="16" IsFormated="True"
                                                             VerticalAlignment="Top"
                                                             Margin="434,0,0,0"
                                                             Width="128"
                                                             TabIndex="4"
                                                             Name="txtSumarizacaoVenda"
                                                             Value="{Binding QuantidadeSumarizada.TotalVenda}"
                                                             IsReadOnly="True"/>
                                </Grid>
                            </Grid>
                        </Controls:SinacorExpander>
                    </Controls:SinacorExpanderContainer>

                </Grid>

            </Controls:SinacorTabItem>
        </Controls:SinacorTabControl>

    </Controls:SinacorExpanderContainer>
</Controls:SinacorWindow>
